/**
 * 
 */
package com.easidea.tim.entity.inventory;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springside.core.dao.extend.Undeletable;

import com.easidea.tim.entity.BaseEntity;

/**
 * 出入库明细
 * @author Harrison
 *
 */
@Entity(name="tim_inventory_checkinout_item")
@org.hibernate.annotations.Entity(dynamicInsert=true,dynamicUpdate=true)
@Cache(region="tim_inventory_checkinout_item",usage=CacheConcurrencyStrategy.READ_WRITE)
@Undeletable(status="deleted")
public class CheckInOutItem extends BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8742841381690568927L;
	
	private CheckInOut checkInOut;
	private Storage storage; // 库存数据
	private Double inputMeterNum; //出入库时录入的原始数据
	
	
	/**
	 * @return the checkInOut
	 */
	@ManyToOne(fetch=FetchType.LAZY,cascade=CascadeType.PERSIST)
	@JoinColumn(name="checkinout_id",nullable=false)
	public CheckInOut getCheckInOut() {
		return checkInOut;
	}
	/**
	 * @param checkInOut the checkInOut to set
	 */
	public void setCheckInOut(CheckInOut checkInOut) {
		this.checkInOut = checkInOut;
	}
	/**
	 * @return the storage
	 */
	@ManyToOne(cascade=CascadeType.PERSIST,fetch=FetchType.EAGER)
	@JoinColumn(name="storage_id")
	public Storage getStorage() {
		return storage;
	}
	/**
	 * @param storage the storage to set
	 */
	public void setStorage(Storage storage) {
		this.storage = storage;
	}
	/**
	 * @return the inputMeterNum
	 */
	@Column(name="input_meter_num", length=10,precision=2)
	public Double getInputMeterNum() {
		return inputMeterNum;
	}
	/**
	 * @param inputMeterNum the inputMeterNum to set
	 */
	public void setInputMeterNum(Double inputMeterNum) {
		this.inputMeterNum = inputMeterNum;
	}
	
	
	
}
